Skip to content

feat: attach files from the web page, and give it a favicon - #202

Merged
deymosh merged 4 commits into
masterfrom
feat/web-uploads
Nov 22, 2026
Merged

deymosh merged 4 commits into
masterfrom
feat/web-uploads

Conversation

@deymosh

@deymosh deymosh commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Opens one of the commands a browser on the web page was refused, and gives the page a favicon.

Decision: upload-file opens, chunked form only. bridge_core::browser_may_send now takes upload-file when it carries chunks: the file travels on the signed stream itself, every chunk under the browser's key, and lands in the workspace's .codedeck/uploads as a phone's does. The Blossom form stays refused: it names a URL for the bridge to download (through the Tor proxy when one is set), a browser has no Blossom server of its own, and taking it would let a page make the bridge fetch any URL it names. Credentials (set-credentials, set-provider-profile, account-action) and the terminal stay refused for now, as decided with the maintainer.

Page. The composer gets Attach; a paste into the message box or a drop on the session works too. Chunks of ~180,000 base64 characters (inside the stream's 256 KiB frame cap), each a signed CMD, the next sent once the last one's OK came back, with progress on the file. The words typed with it become the message and ride in the first chunk, which carries that much less of the file; words over ~90 KB are refused with a file (on their own they still go). The page refuses a file over the bridge's 25 MB cap before reading it, drops a chosen file when another session is opened, and stops a file dropped elsewhere from replacing the page.

Favicon. /favicon.png: the app's launcher logo itself, scaled down from the launcher's foreground image onto its dark background (64 px, 5 KB; img-src 'self' already allows it).

Commits: bridge-core gate + tests → favicon → page → docs (WEB-CLIENT.md, BRIDGE.md).

Cost. No relay traffic. A browser file costs one P-256 verify and one JSON decode per ~135 KB chunk on the bridge (about 190 for a 25 MB file), at the pace the bridge answers; nothing changes for a phone.

Verified

  • bridge-core web_client: a chunk from a browser reaches the runtime, the Blossom form does nothing; both tests fail with the gate flipped.
  • web_page end-to-end (./codedeck e2e): the real runtime and agent host; a browser attaches a two-chunk file and the test reads it back from the path the agent was told.
  • web::tests::every_file_the_page_links_is_served_before_sign_in reads the page's HTML and fetches every file it links.
  • Headless Chrome against a held bridge: a 1.1 MB file in nine chunks arrived byte for byte, a file with an 80 KB (non-ASCII) message arrived with the stream still live, a 100 KB message with a file was refused keeping both, the composer cleared, a chosen file dropped on switching sessions, no console errors.
  • ./codedeck check --changed.

What review changed (the bug hunt found three real issues, all folded into their commits):

  • An OK means the bridge has the chunk queued, not that the file reached the agent; a session that stopped, 16 open uploads or a failed write drop it with no answer on the wire (the phone has the same gap). The page now waits a minute for the agent's message naming the file to show up in the transcript and says so when it does not. A real acknowledgement would be a wire change, left for later.
  • A send that failed after another session was opened left the file attached there; now it is dropped.
  • The docs said an idle partial upload is dropped after a minute; the bridge sweeps them only when the next chunk arrives (existing behaviour), and the docs now say so.
  • Also during review: words typed with a file shrink its first chunk (a long message could otherwise exceed the frame cap and close the stream), and the favicon became the launcher's own image (the first, hand-drawn SVG did not match the logo).

Not checked: Firefox and Safari (neither is installed on the machine this was built on), so that stays owed.

🤖 Generated with Claude Code

deymosh and others added 4 commits November 21, 2026 23:51
A browser may now send upload-file in its chunked form: the file travels
on the signed stream itself, every chunk under the browser's signature,
and lands in the workspace's uploads folder as a phone's does. The
Blossom form stays refused: it names a URL for the bridge to download
(through the Tor proxy when one is set), a browser has no Blossom server
of its own, and taking it would let a page make the bridge fetch any URL
it names.

The engine test covers both forms; the web page end-to-end test attaches
a two-chunk file and reads it back from where the agent was told it is.

Co-Authored-By: Claude Code <[email protected]>
The page's tab showed the browser's blank icon. It now links
/favicon.png: the app's launcher logo itself, scaled down from the
launcher's foreground image onto its dark background with rounded
corners (64 px, 5 KB), served like the page's other files (img-src
'self' already allows it). A test reads the page's HTML and checks that
every file it links is served before sign-in.

Co-Authored-By: Claude Code <[email protected]>
The composer gets an Attach button; a file pasted into the message box
or dropped on the session works too. The file goes up in chunks on the
signed stream, each a signed upload-file command of about 180,000 base64
characters (inside the stream's 256 KiB frame cap), the next sent only
once the bridge answered the last, with its progress shown on the file.
The words typed with it become the message, as on the phone. The page
refuses a file over the bridge's 25 MB cap before reading it, drops a
chosen file when another session is opened so it never reaches the
wrong one, and keeps a file dropped elsewhere from replacing the page.

Verified in headless Chrome against a held bridge: a 1.1 MB file in
nine chunks arrived byte for byte where the fake agent was told it is.

Co-Authored-By: Claude Code <[email protected]>
WEB-CLIENT.md moves upload-file to what a browser may send, in its
chunked form, says why the Blossom form stays refused, and describes how
the page sends a file. BRIDGE.md lists attaching a file among what the
page does.

Co-Authored-By: Claude Code <[email protected]>
@deymosh
deymosh merged commit c35fa1f into master Nov 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant